import json


class Variable_Pool(object):
    def __init__(self, env_param=None, project_param=None):
        # 用于保存项目、接口、环境变量
        self.variable = {}
        # 用于保存提取的返回值
        self.output_Variables = {}
        if isinstance(env_param, str):
            self.variable = json.loads(env_param)
        if isinstance(env_param, dict):
            self.variable = env_param
        if isinstance(project_param, str):
            self.variable = env_param
        if isinstance(project_param, dict):
            self.variable = project_param

    def update_output_variable(self, var):
        if isinstance(var, dict):
            self.output_Variables.update(var)
        else:
            pass
